Repository navigation
feat(spec): count_true / count_false — a boolean column's Yes / No counts in the list footer - #35944
Conversation
…umns (WIP) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgVspkxqkUdkYxY1RHf
…WIP) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgVspkxqkUdkYxY1RHf
…regate door (WIP) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgVspkxqkUdkYxY1RHf
…page and the grid README; changeset Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgVspkxqkUdkYxY1RHf
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgVspkxqkUdkYxY1RHf
📓 Docs Drift CheckThis PR changes 2 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 174 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin c1bdbfc37703057eb361f6d610f5f1825f54be22 && git checkout c1bdbfc37703057eb361f6d610f5f1825f54be22
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 170ca481f0aeec14ca06d74ec3d57c654997e698 5107231a969fa2c19b78f8a29e46002c30c16a85 && git checkout -B drift-repro 170ca481f0aeec14ca06d74ec3d57c654997e698 && git merge --no-ff 5107231a969fa2c19b78f8a29e46002c30c16a85
node scripts/docs-audit/affected-docs.mjs --json 170ca481f0aeec14ca06d74ec3d57c654997e698
|
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgVspkxqkUdkYxY1RHf
|
repo:objectstack#1 · os-sales · session_01L6bhgUmopshYqDCrYekUj4 席位核对 — ACCEPT (L1-b), CI pendingHead-sha: 5107231 · read 2026-11-20T22:18Z · full read, base f909734 (PR 1 #35919 merged) · L1 only, never an L2 (Metadata-protocol 维护者速读
Checked
For the L2 (boundary note, not a finding)
Owed
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Posted 2026-11-20T22:39Z. The brief handed to the isolated contract reviewer at Contract review brief — PR #35944 @
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Contract reviewServed-tier: Read at 2026-11-20T22:44Z: card #35702 (body and all seven comments, rulings 7045525672 and 7051689474 included), PR #35944 (body, the 30-file list, the net diff against ① Derived judgments
② Semver levelClause-②: yes (widening) — on the PR body and in ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix.
Implementing files, against the contract:
Nits (no effect on correctness or the contract; none is fixed on this head — accepted deviations or one follow-up card):
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob L2 adoption and landing · 2026-11-20T22:50Z · The seat adopts the isolated contract-review record 7052446592 on head L1-b ACCEPT 7051975722 on |
Requested by Sales · project thread
Fixes #35702
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: none — no page under
skills/**lists the column summary members; the docs that do (content/docs/ui/views.mdx, the generatedcontent/docs/references/ui/view.mdx, theplugin-gridREADME) are updated hererepo:objectstack#1 · os-sales · session_01L6bhgVspkxqkUdkYxY1RHf
Flow: dev-thread rule (maintainer 2026-11-20 09:22:50Z 「所有 p1 都按照新规则执行」): the card thread builds itself; L1 and the isolated L2 run in parallel at hand-back, the maintainer's 09:22Z ruling for every p1 card (deviates from contract-review.md:18 until the skill card lands).
The second and last PR of #35702 (PR 1 #35919, merged f909734, left exactly this): the boolean 「是」/「否」 counts the card's 要做的 lists — 「补两种计算:布尔字段的「是」的条数、「否」的条数」. Clause-② is a widening:
ColumnSummarySchemagains two members, and the derived rows ofColumnSummaryAggregationgain areadslist (fromstays, the first of them). Contract face, L2 atCONTRACT_REVIEW_TIER.Null-cell ruling: record 7051689474 on #35702 — the maintainer chose 「不算,未填单独算「空」」 (option A, 2026-11-20 22:01:58Z).
count_truecounts the cells holdingtrue,count_falsethe cells holdingfalse(count_FIELD−sum_FIELD, never the record count); a cell with no value is in neither and shows under 「空」 (count_empty), so 是 + 否 = the filled count; with every value null, or no rows, 「是」 reads 0. That is what this PR builds.维护者速读
What changes
packages/spec/src/ui/view.zod.ts,view-grouping-query.ts).ColumnSummarySchemagainscount_trueandcount_false. Both map by DERIVATION, the fork-i route the four filled / empty members took — no newAggregationFunction, no driver change: booleans aggregate as numbers on every backend (ruling [finding]AGGREGATION_ROWShas no boolean column, so the cross-driver aggregation conformance family cannot see a boolean aggregand on any face #11152,aggregation-conformance'ssum(flag)row on six backends), socount_true=SUM(field)andcount_false=COUNT(field) − SUM(field).COLUMN_SUMMARY_AGGREGATION's derived rows carryreads, every node the member reads (count_true:['sum'];count_false:['sum', 'count']; the four filled / empty:['count']).columnSummaryNodeFunctions(mapping)is the one reading of a row's nodes; the group header compiler uses it, and so do the footer's whole-set query and the lint below.deriveColumnSummaryreadscount_trueas the sum,0when the sum answered no value (no non-null cell), andcount_falseas the non-null count less the sum.COLUMN_SUMMARY_FIELD_TYPES/isColumnSummaryCompatibleWithFieldTyperestrict the two members to the boolean class (boolean,toggle, pinned equal toBOOLEAN_VALUE_TYPES).packages/lint/src/validate-list-view-field-refs.ts).columnSummaryRefusaljudges a restricted member by that table:count_true/count_falseover any other type islist-view-summary-field-type-refused(error). The aggregate door ACCEPTSSUM(field)over a number, so without this the footer would print a total under the label 「是」 and nothing would refuse it. Itsos explainentry gains the paragraph.ui/packages/plugin-grid).offeredColumnSummarieslists Count of Yes / Count of No first on a boolean or toggle column, and only where the spec's table allows them.wholeSetSummaryNodesasks every node a member reads (oneSUM(approved)and oneCOUNT(approved)serve both counts andcount_empty). The page fallback computes them off the rows as the cell reads them: only a realtrue/falseis a value, so a null cell is neither, as on the server. The figure is drawn asYes 12/No 3, a plain count.grid.summary.countTrue/countFalse(the footer word, the pack's own Yes / No) andmenuCountTrue/menuCountFalse(the menu entry) in all eleven packs.content/docs/ui/views.mdx, theplugin-gridREADME; generatedcontent/docs/references/ui/view.mdx,api-surface/ui.json,export-origins/ui.json. Changeset35702-boolean-yes-no-counts.md(@objectstack/specand@objectstack/lintminor,Metadata-protocol: added;@object-ui/plugin-grid,@object-ui/i18npatch).Read first, by risk:
packages/spec/src/ui/view-grouping-query.ts(thereadsrows,deriveColumnSummary's new branch,summaryAggregationNodes' loop),packages/lint/src/validate-list-view-field-refs.ts(columnSummaryRefusal's restricted arm, which now resolves the field before the aggregate-kind early return),ui/packages/plugin-grid/src/useWholeSetSummary.ts(wholeSetSummaryNodes).Tests
New:
packages/spec/src/ui/view-grouping-query.test.ts—count_true / count_false: the compiled nodes (onesum_approved, the sharedcount_approved); per group, a null cell in neither count andtrue + false = filled(3 / 2 / 1 null; all null reads 0 / 0; no true reads 0); a sum that answered no value reads 0 true, a missing column readsundefined, a string-spelled sum reads as a number; the field-type table (boolean class only, pinned toBOOLEAN_VALUE_TYPES, fail-closed on shape);columnSummaryNodeFunctionsover every row kind; the alias collision on a field namedsum_approved. The mapping-table pin carries the two new rows andreadson every derived row.packages/rest/src/list-view-grouping-query-door.test.ts§7b — the real aggregate door, on driver-sql (better-sqlite3) and the in-memory tier: the compiled grouped query and the footer's whole-set query (nogroupBy) answer each unit's and the whole set's true / false / empty counts, tallied off the seeded rows (every fourth unset); the one-row unit with no true reads 0.packages/lint/src/validate-list-view-field-refs.test.ts— refuses the two members over a number and a text field (object form too), accepts them on booleans, and agrees with the spec's table over everyFieldType.ui/packages/plugin-grid/src/__tests__/footerCalculationPicker-35702.test.tsx— the boolean / toggle offer (the two counts first, no arithmetic); never on number, currency, text, select, date, lookup; a boolean column's menu lists Count of Yes / Count of No first, a pick drawsYes 1thenNo 1.ui/packages/i18n:zh-Hant.tsregenerated fromzh-Hans.ts(gen:zh-hant; the first CI run's Test UI 8/16 red was this file hand-written).ui/packages/plugin-grid/src/__tests__/footerSummaryScope-12081.test.tsx— 300 rows over pages of 25: the yes / no / empty counts read the whole set off oneSUMand oneCOUNTnode; with no aggregate door they are the page's, labelled(this page), and an unset cell is neither.Migrated: the
COLUMN_SUMMARY_AGGREGATIONpin (readson the derived rows),view.test.ts's member list, theui/packages/typesparity list (two members added). Voided: none.Local runs
Head
5107231a(the last commit is the generatedzh-Hant.tsonly; every run below is on1d91bf50or later unless named):@objectstack/spec:vitest run src/ui/view-grouping-query.test.ts src/ui/view.test.ts—Test Files 2 passed (2),Tests 550 passed (550), lockVERDICT command-exit 0.typecheck(incl.check:test-typecheck) exit 0.check:api-surface,check:docs,check:export-originswere red beforegen:api-surface/gen:schema+gen:docs/gen:export-origins, green after;check:authorable-surface,check:liveness,check:llms-txtexit 0.@objectstack/lint:validate-list-view-field-refs,validate-sortable-fields,rule-explanations—Test Files 3 passed (3),Tests 316 passed (316);typecheckexit 0.@objectstack/rest:list-view-grouping-query-door.test.ts(driver-sql better-sqlite3 + in-memory) —Test Files 1 passed (1),Tests 55 passed (55);typecheckexit 0.ui:plugin-grid(footerCalculationPicker-35702,footerSummaryScope-12081,useColumnSummary,useColumnSummary.i18n-4024,column-features) +types/spec-subschema-parity—Test Files 6 passed (6),Tests 141 passed (141); the wholepackages/i18n/project after the regeneration —Test Files 105 passed (105),Tests 1957 passed | 13 skipped;vitest run scripts/—Test Files 172 passed | 2 skipped.dispatch-gates --commands, 120 on this tree):--ranreads 118 run, 2 NOT MEASURED, 0 UNRUN. NOT MEASURED:check:dual-build-cjs-loads(PREREQUISITE NOT MET: dists of untouched packages absent),check:type-check-debt(ran past the local 300 s window). One recorded red is the container, not the diff:check:dts-closurenamespackages/cli,plugins/organizationsandverify.d.tsmissing, packages this PR does not touch, builtOS_SKIP_DTS=1here for the browser stand. CI's runs are the reading for all three.@object-ui/plugin-grid/@object-ui/i18ntype-check(the ui dependency closure's declarations are not built in this container: every error is TS2307 on an@object-ui/*import or downstream of one, none in the two changed source files); Type Check UI is the reading.Acceptance notes
ui/packages/fields/src/widgets/BooleanField.tsx:124,139), while the list cell draws it as "No value". Under A an unset value is not counted as 「否」 even though the form shows it unticked.count_true/count_falsecolumn's whole-set figure waits for the object's field catalogue, as everysumnode does (isMoneyAggregate: arecord-mode currency check, ADR-0144 D6); the page figure shows until then, labelled as the page's.count_trueover a number reaching the server unlinted would answer that column's sum. The lint is the refusal (os validate,os build, the save door through the reference-integrity suite), the same tier the aggregate × field-type pairs are judged at.Verification
Browser (showcase, own backend :43744 + console dev :53744 off this branch, admin), evidence in
/mnt/project-files/build-seat1/35702-pr2/:b-02-boolean-menu.png). The Number and Rating columns' menus list Sum / Avg / Min / Max and the counts, the Name and Select columns the counts only — no Count of Yes / No on any of them.PATCH /api/v1/data/sys_personal_view/ID200 with onlyf_booleangainingsummary: "count_true"→ the cell reads "Yes 1" (b-12) → reload → still "Yes 1" (b-13) → pick Count of No → PATCH 200, "No 1" (b-14). The two seeded rows holdtrueandfalse.POST /api/v1/data/showcase_field_zoo/querywith the footer's nodes answers{ count: 2, sum_f_boolean: 1, count_f_boolean: 2 }(Yes 1, No 1).showcase_field_zoo.default: the pick's draft save answers 403 and the pick is taken back, PR 1's documented behaviour for a view a read-only package ships.Two-minute check: on any object with a boolean field, open its table view as an admin, click under the boolean column — the menu starts with "Count of Yes" / "Count of No"; pick one, the cell reads "Yes N" at once.
Human Minimum
packages/specholds no runtime logic beyond the pure mapping helpers that already live there.pnpm lintis CI's.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgVspkxqkUdkYxY1RHf